package lab02.test19;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        //输入字符串
        String result="HelloWord";
        char[] ch=result.toCharArray();
        //从键盘输入数据，构造函数要实例化
     StringBuffer sca=new StringBuffer();
      //调用函数来实现大小写转换
        //行为：实现字符串的大小写转换
        int i;//定义一个实现大小写转换的变量
        for (i=result.length()-1;i>=0;i--){
            if (ch[i]>='A'&&ch[i]<='Z'){
                sca.append(String.valueOf(ch[i]).toLowerCase());
                //大写转换为小写
            }else if (ch[i]>='a'&&ch[i]<='z'){
                sca.append(String.valueOf(ch[i]).toUpperCase());
            }
        }
        System.out.println(sca.toString());
    }
}
